Add integration test for Maven 4 new dependency scopes (MNG-8750)#11025
Merged
gnodet merged 1 commit intoapache:masterfrom Sep 29, 2025
Merged
Add integration test for Maven 4 new dependency scopes (MNG-8750)#11025gnodet merged 1 commit intoapache:masterfrom
gnodet merged 1 commit intoapache:masterfrom
Conversation
Member
|
Didn't we made new scopes available in model 4.1.0+ ONLY? As otherwise those can get deployed, no? |
Contributor
Author
New features are. In this case, those are new values for existing stuff, and it seems they are not. This could be added to model validation. |
Member
|
That's another thing, i remember adding them to model validation... |
Member
3502cf0 to
d3718df
Compare
This integration test verifies the correct behavior of the new dependency scopes introduced in Maven 4: - compile-only: Available during compilation, not at runtime - test-only: Available during test compilation, not at test runtime - test-runtime: Available during test runtime, not at test compilation The test also verifies that consumer POMs exclude these new scopes for Maven 3 compatibility.
d3718df to
71851dd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive integration test for the new dependency scopes introduced in Maven 4:
compile-only: Available during compilation, not at runtimetest-only: Available during test compilation, not at test runtimetest-runtime: Available during test runtime, not at test compilationTest Coverage
The integration test (
MavenITmng8750NewScopesTest) verifies:✅ Classpath Inclusion/Exclusion:
compile-onlydependencies appear in compile classpath but NOT runtime classpathtest-onlydependencies appear in test compile classpath but NOT test runtime classpathtest-runtimedependencies appear in test runtime classpath but NOT test compile classpath✅ Consumer POM Compatibility:
✅ Runtime Behavior:
NoClassDefFoundErrorwhen accessed incorrectlyTest Structure
Main Test Class:
MavenITmng8750NewScopesTest.javasuper("[4.0.0,)"))Test Modules:
compile-only-test- Tests compile-only scope behaviortest-only-test- Tests test-only scope behaviortest-runtime-test- Tests test-runtime scope behaviorcomprehensive-test- Tests all scopes working togethervalidation-failure-testvalidation-success-testTest Repository: Local repository with test dependency JARs and POMs
Files Added
Verification
The test can be run with:
mvn test -Dits.test=MavenITmng8750NewScopesTestThis ensures that the new Maven 4 scopes work as designed while maintaining backward compatibility through proper consumer POM generation.
Pull Request opened by Augment Code with guidance from the PR author